package com.example.simpleapp.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 简单的控制器，提供一个测试接口
 */
@RestController
@RequestMapping("/api")
public class HelloController {

    /**
     * 简单的问候接口
     */
    @GetMapping("/hello")
    public String hello() {
        return "Hello, World! 应用启动正常 - " + 
               LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
    }
    
    /**
     * 健康检查接口
     */
    @GetMapping("/health")
    public String healthCheck() {
        return "OK";
    }
}
